package com.gientecher.getway.controller;

import com.alibaba.fastjson.JSONObject;
import com.gientech.loancommon.vo.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @PostMapping("/user/login")
    public ResponseResult login(){
        JSONObject data = new JSONObject();
        data.put("token","admin-token");
        return new ResponseResult(data);
    }

    @PostMapping("/user/info")
    public ResponseResult info(){
        JSONObject data = JSONObject.parseObject("{\"roles\":[\"admin\"],\"introduction\":\"I am a super administrator\",\"avatar\":\"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif\",\"name\":\"Super Admin\"}");
        return new ResponseResult(data);
    }
}
